/* 
存取器
*/

(function(){
  class Person {
    b = 200
    static a = 100
    firstName:string
    lastName:string
    constructor(firstName:string,lastName:string){
      this.firstName = firstName
      this.lastName = lastName
    }

    set fullName(val:string){
      let arr = val.split('-')
      this.firstName = arr[0]
      this.lastName = arr[1]
    }

    get fullName(){
      return this.firstName + '-' + this.lastName
    }
  }

  let p1 = new Person('zhao','liying')
  // console.log(p1.fullName);
  p1.fullName = 'liu-haha'
  console.log(p1);
  
  
  
})()